#include <iostream>
#include <string>

using namespace std;

bool isalpha(char c) {
	return c>='a' && c<='z';
}

bool isnum(char c) {
	return c>='0' && c<='9';
}

void assign_x_or_n(string& tk, int &nx, int &n, int isleft, int last_op) {
	if(tk.empty()) {
		return;
	}
	if( isalpha(tk.back())){
		tk.pop_back();
		if(tk.empty()) {
			nx += nx+1*last_op*isleft;
		}
		else {
			nx += std::stoi(tk) * last_op * isleft;
		}
	}
	else if(isnum(tk.back())) {
		if(!tk.empty()) {
			n+=  std::stoi(tk) * last_op * isleft;
		}
	}
}

int main()
{
	string e;
	cin >> e;
	int n=0;
	int nx=0;
	int isleft = 1;
	string tk;
	char last_op = 1;
	char x;

	for(int i=0; i<e.length(); i++){
		if( isnum(e[i])) {
			tk.push_back(e[i]);
		}
		else if( isalpha(e[i])) {
			tk.push_back(e[i]);
			x = e[i];
		}
		else {
			assign_x_or_n(tk, nx, n, isleft, last_op);
			if( e[i] == '+') {
				last_op = 1;
			}
			else if(e[i]=='-') {
				last_op = -1;
			}
			else {
				isleft=-1;
				last_op=1;
			}
			tk.clear();
		}
	}
	assign_x_or_n(tk, nx, n, isleft, last_op);
	float r = -(float)n/nx;
	if(r==0)
		r=0;
	printf("%c=%.3f", x, r);

	return 0;
}
